<?php

/**
 * ServizioAllegato form base class.
 *
 * @method ServizioAllegato getObject() Returns the current form's model object
 *
 * @package    domande_bandi
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseServizioAllegatoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                    => new sfWidgetFormInputHidden(),
      'profilo_professionale' => new sfWidgetFormInputText(),
      'datore_lavoro'         => new sfWidgetFormInputText(),
      'dal'                   => new sfWidgetFormDateTime(),
      'al'                    => new sfWidgetFormDateTime(),
      'tipo_orario'           => new sfWidgetFormInputCheckbox(),
      'n_ore_orario'          => new sfWidgetFormInputText(),
      'domanda'               => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Domanda'), 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'                    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'profilo_professionale' => new sfValidatorString(array('max_length' => 255)),
      'datore_lavoro'         => new sfValidatorString(array('max_length' => 255)),
      'dal'                   => new sfValidatorDateTime(),
      'al'                    => new sfValidatorDateTime(),
      'tipo_orario'           => new sfValidatorBoolean(),
      'n_ore_orario'          => new sfValidatorInteger(),
      'domanda'               => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Domanda'))),
    ));

    $this->widgetSchema->setNameFormat('servizio_allegato[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ServizioAllegato';
  }

}
